FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}

ARG docker_container_name
ARG image_version
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf

# Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive

# Pass the image_version to container
ENV IMAGE_VERSION=$image_version

# Update apt's cache of available packages
RUN apt-get update

COPY ["config_checker.py", "/usr/bin/"]
COPY ["auditd_config_files/", "/usr/share/sonic/auditd_config_files/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]

RUN chmod +x /usr/bin/config_checker.py

ENTRYPOINT ["/usr/local/bin/supervisord"]
